﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArraysPractise
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] testArray = new int[2,3];
            FillArrayWithRandomNumbers(testArray);
            PrintArrayToConsole(testArray);
            int evenCount = 0;
            int oddCount = 0;
            for (int i = 0; i < 2; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (testArray[i, j]%2 == 0)
                    {
                        evenCount++;
                    }
                    else
                    {
                        oddCount++;
                    }
                }
            }
            Console.WriteLine("Odd count: {0}", oddCount);
            Console.WriteLine("Even count: {0}", evenCount);
        }

        static void FillArrayWithRandomNumbers(int[,] array)
        {
            Random rnd = new Random();
            for (int i = 0; i < array.GetLength(0); i++)
            {
                for (int j = 0; j < array.GetLength(1); j++)
                {
                    array[i, j] = rnd.Next(1, 21);
                }
            }
        }



        static void PrintArrayToConsole(int[,] arrayForPrint)
        {
            for (int i = 0; i < arrayForPrint.GetLength(0); i++)
            {
                for (int j = 0; j < arrayForPrint.GetLength(1); j++)
                {
                    Console.Write("{0}\t", arrayForPrint[i, j]); 
                }
                Console.WriteLine();
            }
        }    
    }
}
